var express = require("express");
var app = express();

//设置默认的模板引擎，此时express将帮你引入ejs，所以你一定要提前安装ejs模块
//cnpm install ejs --save
//命令它使用模板引擎
app.set("view engine","ejs");

//罗列中间件
app.get("/",function(req,res){
    res.render("index",{
        "dongxi" : "8个手机",
        "qian" : 100 * 8,
        "ouxiang" :[
            {"xingming" : "王俊凯", "nianling" : 18},
            {"xingming" : "杨颖" , "nianling" : 30},
            {"xingming" : "蒲永刚" , "nianling" : 28}
        ]
    });
});

app.listen(3000);